<form action="index" method="POST" id="frmAddListType" enctype="multipart/form-data" autocomplete="off">
<!--ID cua ListType-->
<?php echo $this->formHidden("hdn_listtype_id",$this->iListTypeId,null); ?>	
<!--Sinh mot hidden luu list ID ma NSD chon!-->
<?php echo $this->formHidden("hdn_object_id_list","",null); ?>	
<!--Sinh mot hidden luu gia tri xac dinh so ban ghi / 1 trang!-->	
<?php echo $this->formHidden("hdn_record_number_page",$this->NumberRowOnPage,null); ?>				
<!--Sinh mot hidden luu gia tri trang hien thoi 1, 2, ...!-->
<?php echo $this->formHidden("hdn_page",$this->numCurrentPage,null); ?>	
<!--Luu gia tri kiem tra cho cap nhat -->
<?php echo $this->formHidden("hdn_update",'OK',null); ?>	

<?php echo $this->formHidden("hdn_xml_tag_list",'',null); ?>			
<!--Bien hdn_xml_value_list dung de luu danh sach cac gia tri cua cac THE XML tuong ung voi cac THUOC TINH cua mot doi tuong-->			
<?php echo $this->formHidden("hdn_xml_value_list",'',null); ?>				
<?php echo $this->formHidden("hdn_owner_code_list",'',null); ?>	
<input type = "hidden" name = "showLeftMenu" id = "showLeftMenu" />		
<div id = "form-container"> 	
	<div id = "form-header">
		<div id = "form-header-left" style="width:90%;">
			<?=$this->bodyTitle;?>
		</div>
		<div id = "form-header-right">&nbsp;</div>
	</div>
	<div id = "form-content">
		<div>
			<label class="lbl_title normal_label">Mã loại danh mục<small class="normal_starmark">*</small></label>
			<?=$this->formText('C_CODE',$this->arrInput['C_CODE'],array('size'=>50,'class'=>'textbox','optional'=>false,'message'=>'Ma LOAI DANH MUC khong duoc de trong!'));?>	
		</div>
		<div>
			<label class="lbl_title normal_label">Tên loại danh mục	<small class="normal_starmark">*</small></label>
			<?=$this->formText('C_NAME',$this->arrInput['C_NAME'],array('size'=>90,'class'=>'textbox','optional'=>false,'message'=>'TEN LOAI DANH MUC khong duoc de trong!'));?>
		</div>
		<div>
			<label class="lbl_title normal_label">Thứ tự hiền thị</label>
			<?=$this->formText('C_ORDER',$this->arrInput['C_ORDER'],array('size'=>10,'class'=>'textbox'));?>
		</div>
		<div>
			<label class="lbl_title normal_label">Import dữ liệu</label><?php
			$ChkImportStatus = false;
			if ($this->arrInput['C_IMPORT_STATUS']){
				$ChkImportStatus = true;
			}?>
			<?=$this->formcheckbox('CHK_IMPORT_STATUS',$this->arrInput['C_IMPORT_STATUS'],array('size'=>10,'checked'=>$ChkImportStatus,'class'=>'textbox','optional'=>true));?>
			<div class="lbl_title normal_label" style="display:inline;" id="ID_IMPORT_DATA_STATUS">Có (Cho phép NSD Import dữ liệu từ file Excel)</div>			
		</div>
		<div>
			<label class="lbl_title normal_label">Tự động sinh mã đối tượng</label><?php
			$ChkAutoGenerateCodeStatus = false;
			if ($this->arrInput['C_AUTO_GENERATE_OBJECT_STATUS']){
				$ChkAutoGenerateCodeStatus = true;
			}?>			
			<?=$this->formcheckbox('CHK_AUTO_GENERATE_OBJECT_CODE',$this->arrInput['C_AUTO_GENERATE_OBJECT_STATUS'],array('size'=>10,'checked'=>$ChkAutoGenerateCodeStatus,'class'=>'textbox','optional'=>true));?>
			<div class="lbl_title normal_label" style="display:inline;" onClick="chk_show_hide_auto_generate_object_code();">Có (Cho phép NSD định nghĩa  tự động sinh mã đối tương)</div>			
		</div><?php
			$DisplayStatus = "none";
			if ($this->arrInput['C_AUTO_GENERATE_OBJECT_STATUS']){
				$DisplayStatus = "block";
			}?>		
		<div id="ID_AUTO_GENERATE_OBJECT_CODE" style="display:<?=$DisplayStatus;?>;">
			<label class="lbl_title normal_label">Mã tiền tố đối tượng</label>
			<?=$this->formText('TXT_AUTO_GENERATE_OBJECT_CODE',$this->arrInput['C_AUTO_GENERATE_OBJECT_CODE'],array('size'=>50,'class'=>'textbox','message'=>'Phai xac dinh Ma Tien do doi tuong danh muc!'));?>
		</div>						
		<div>
			<div><label class="lbl_title normal_label">File XML</label></div>
			<div>
				<dd id = "file_from_server">
					<?=$this->formText('txt_xml_file_name',$this->arrInput['C_XML_FILE_NAME'],array('type'=>'text','style'=>'display:inline;','size'=>77, 'class'=>'textbox'));?>
					<?=$this->formButton("popupDialog","Browse",array("type"=>"button",'style'=>'display:inline;',"class"=>"link-button","onClick"=>"openmypage(); return false"))?>	
				</dd>
				<dd id = "file_form_clien" style = "display:none;"><?=$this->formFile('C_XML_FILE_NAME',$this->arrInput['C_XML_FILE_NAME'],array('size'=>50));?></dd>
			</div>	
		</div>
		<div>						
			<!--Goi mot Digloa bang javascript-->				
		 	 <div id="somediv" style="display:none">
				<?php echo $this->divDialog;?>
			 </div>	
		</div>
		<div>
			<label class="lbl_title normal_label">Đơn vị sử dụng<small class="normal_starmark">*</small></label>
			<table id="table_owner_code" cellspacing="0" cellpadding="0" class = "table_detail_doc" style = "width:70%;" border = "1">
			<col width = "2%"><col width = "48%"><col width = "2%"><col width = "48%">
				<?php 
					$sHtml = "<tr>";
					$i = 0;
					foreach ($_SESSION['SesGetAllOwner'] as $owner){
						$i++;
						$sHtml .= "<td><input type = 'checkbox' name = 'chk_onwer_code_list[]' value = '" . $owner['code'] . "'/></td>";
						$sHtml .= "<td onclick = 'set_checked(document.getElementsByName(\"chk_onwer_code_list[]\"),\"" . $owner['code'] . "\",\"table_owner_code\")'>" . $owner["name"] . "</td>";
						if($i == 2){
							$sHtml .= "</tr><tr>";
							$i = 0;
						}
					}
					echo $sHtml;
				?>
			<tr>
				<td colspan = "4" align = "right" class="small_radiobutton">
					<input type="radio" onclick="set_check_all(document.getElementsByName('chk_onwer_code_list[]'),1);" hide="true" value="1" optional="true" name="rad_owner_code_list"><font onclick = "document.getElementsByName('rad_owner_code_list')[0].checked = true;set_check_all(document.getElementsByName('chk_onwer_code_list[]'),1);">Chọn tất cả</font>
					<input type="radio" onclick="set_check_all(document.getElementsByName('chk_onwer_code_list[]'),2);" hide="true" value="2" optional="true" name="rad_owner_code_list"><font onclick = "document.getElementsByName('rad_owner_code_list')[1].checked = true;set_check_all(document.getElementsByName('chk_onwer_code_list[]'),0);">Bỏ chọn tất cả</font>
				</td>
			</tr>
			</table>
		</div>
		<div>
			<label class="lbl_title normal_label">Trạng thái</label>
			<div>
				<?=$this->formCheckbox('C_CLIENT',1, array('checked' => false,'onClick'=>'show_hide_div()'));?><font class = "lbl_title normal_label">Chọn từ Client </font>
				<?=$this->formCheckbox('C_STATUS',1, array('checked' => true));?><font class = "lbl_title normal_label">Hoạt động</font>	
				<?=$this->formCheckbox('C_SAVE_AND_ADD_NEW',1, array('checked' => false));?><font class = "lbl_title normal_label">Ghi và thêm mới</font>
			</div>
		</div>
	</div>
	<div class = "button-container">
		<input name = "btn_update" id = "btn_update" type="button" value="Cập nhật" class="link-button clsave">
		<input name = "btn-back" id = "btn-back" type="button" value="Quay lại" class="link-button clback">
	</div>
</div>	
</form>
<script type="text/javascript">
	$("#C_CODE").focus();
	function openmypage(){ 
		divwin=dhtmlwindow.open("divbox", "div", "somediv", "EFY.COM.VN", "width=450px,height=300px,left=300px,top=100px,resize=1,scrolling=1")
	}
	//
	$('#ID_IMPORT_DATA_STATUS').click(function(){						
		if ($('#CHK_IMPORT_STATUS').is(":checked")){			
			$('#CHK_IMPORT_STATUS').attr("checked", false);			
		}else{			
			$('#CHK_IMPORT_STATUS').attr("checked", true);			
		}
	});		
	//
	$('#CHK_AUTO_GENERATE_OBJECT_CODE').click(function(){				
		if ($('#CHK_AUTO_GENERATE_OBJECT_CODE:checked').val() !== undefined){			
			$('#CHK_AUTO_GENERATE_OBJECT_CODE').attr("checked", true);
			$('#ID_AUTO_GENERATE_OBJECT_CODE').show();
			if ($('#TXT_AUTO_GENERATE_OBJECT_CODE').val() == ""){
				$('#TXT_AUTO_GENERATE_OBJECT_CODE').attr("value", $("#C_CODE").val());
			}
		}else{			
			$('#CHK_AUTO_GENERATE_OBJECT_CODE').attr("checked", false);
			$('#ID_AUTO_GENERATE_OBJECT_CODE').hide();
		}
	});		
</script>
<?php //} 
//else 
//	echo 'Bạn không có quyền truy cập chức năng này';
?>
					




							